-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ffmpeg 7.0 Update: Use new channel layout #1626
base: master
Are you sure you want to change the base?
Conversation
25075c5
to
5eb40d5
Compare
42cfe85
to
e135e5b
Compare
d04bd4b
to
9b8956a
Compare
This compiles with ffmpeg 7.0 and is currently used in the Arch Linux extra-staging repository: https://gitlab.archlinux.org/archlinux/packaging/packages/ovenmediaengine/-/commit/3a029703f7f9ce35d31487848efd9524516bf220 It is however entirely untested and will remain a draft until then. |
I'm marking this as ready - I've been using this for a few weeks now, including transcoding with ffmpeg v7 openh264. The Arch Linux package is now using this patch directly. |
``` [ 17/505| 3%] [static] libapi_server.a: C++ projects/api_server/controllers/v1/vhosts/apps/output_profiles/output_profiles_controller.cpp => intermediates/RELEASE/objs/api_server/controllers/v1/vhosts/apps/output_profiles/output_profiles_controller.o In file included from projects/providers/multiplex/multiplex_stream.h:11, from projects/providers/multiplex/multiplex_application.h:16, from projects/api_server/controllers/v1/vhosts/apps/multiplex_channels/multiplex_channels_controller.cpp:13: projects/modules/ffmpeg/ffmpeg_conv.h: In static member function ‘static bool ffmpeg::Conv::ToMediaTrack(AVStream*, std::shared_ptr<MediaTrack>)’: projects/modules/ffmpeg/ffmpeg_conv.h:375:130: error: ‘AVCodecParameters’ {aka ‘struct AVCodecParameters’} has no member named ‘channel_layout’; did you mean ‘ch_layout’? 375 | media_track->GetChannel().SetLayout(ffmpeg::Conv::ToAudioChannelLayout(stream->codecpar->channel_layout)); | ^~~~~~~~~~~~~~ | ch_layout ```
``` /** * Audio only. The channel layout bitmask. May be 0 if the channel layout is * unknown or unspecified, otherwise the number of bits set must be equal to * the channels field. * @deprecated use ch_layout */ attribute_deprecated uint64_t channel_layout; ```
``` /** * duration of the corresponding packet, expressed in * AVStream->time_base units, 0 if unknown. * - encoding: unused * - decoding: Read by user. * * @deprecated use duration instead */ attribute_deprecated int64_t pkt_duration; ```
…v_get_channel_layout_describe ``` /** * Return a description of a channel layout. * If nb_channels is <= 0, it is guessed from the channel_layout. * * @param buf put here the string containing the channel layout * @param buf_size size in bytes of the buffer * @param nb_channels number of channels * @param channel_layout channel layout bitset * @deprecated use av_channel_layout_describe() */ attribute_deprecated void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout); ```
``` /** * Audio only. The number of audio channels. * @deprecated use ch_layout.nb_channels */ attribute_deprecated int channels; ```
Disabling lzo isn't allowed anymore FFmpeg/FFmpeg@df27292 Couldn't find commits for the other two. But I suspect they are now enabled by default.
Otherwise this fails with `Cannot change ownership to uid 66878, gid 100: Invalid argument`, at least with podman.
…n transcoder context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. Hope this gets merged into main, because getting ffmpeg 5 to work gets more and more difficult on more current OS versions
ffmpeg 7.1 changed the API again: FFmpeg/FFmpeg@7f17e0e
context->hw_frames_ctx = av_buffer_ref(hw_frames_ref);
av_buffer_unref(&hw_frames_ref); Any ideas? |
|
First of all, thank you for the PR. I will internally discuss changing FFmpeg to 7.x, and after that, I will modify the code related to hw_frames_ctx of AVFilterList. |
Since this blocks the ffmpeg 7.1 release on Arch I've moved the package to our |
Context: At Arch Linux I build OvenMediaEngine against the system libraries. Since we currently rebuild stuff for ffmpeg 7.0 this patch is required.
Please bear with me here, I don't really code in C++.
Note: There was a flag
FF_API_OLD_CHANNEL_LAYOUT
, which has been dropped in v7.